package com.mine.distinctionteam;

import rx.subscriptions.CompositeSubscription;

/**
 * Created by zhonghang on 2016/10/9.
 */

public class MainPresenter implements MainContract.Presenter {
    private MainContract.View mView;
    private MainContract.Modle mModle;
    private CompositeSubscription compositeSubscription;

    public MainPresenter() {

    }

    @Override
    public void detachView() {
        //此处用于销毁网络连接，或者查询数据库的操作，耗时操作导致view不能被正常回收导致内存泄漏
        compositeSubscription.clear();
    }

    @Override
    public void attachView(MainContract.View view) {
        mView = view;
        this.mModle = new MainModle();
        compositeSubscription = new CompositeSubscription();
    }
}
